#ifndef _CHARACTER_H_
#define _CHARACTER_H_

#include <netlib/session/session.h>
#include "../../common/define.h"

class GameRoom;
class Channel;

class Character : public netlib::session::Player
{
public:
	Character();
	virtual ~Character();

	virtual void onClose();
	virtual void onHackingUser();
	virtual void onConnect();


	void setPlayingChannel( Channel *channel );
	void initialize();
	bool send( netlib::packet::Packet *packet , bool encrypt = true );
	GameRoom *getPlayingGameRoom();
	Channel *getPlayingChannel();

	char *getUserID();
	void setUserID( char *userID );

	void setReady( bool ready );
	bool isReady();

	void setChannelMaster( bool isMaster );
	bool isChannelMaster();
	BYTE getSlot();
	void setSlot( BYTE slot );

	bool isStartedGame();
	void setStartedGame( bool isStartedGame );
private:
	Channel *m_playingChannel;
	char m_userID[ CHARACTER_ID_LENGTH + 1 ];
	bool m_ready;
	bool m_isStartedGame;

	BYTE m_slot;
	bool m_isChannaleMaster;
};

#endif